﻿@model PlanificadorDeEventos.Models.Evento

@{
    ViewBag.Title = "Editar";
}

<h2>Editar</h2>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Evento</legend>

        @Html.HiddenFor(model => model.ID)

        <div class="editor-label">
            @Html.LabelFor(model => model.Date)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Date)
            @Html.ValidationMessageFor(model => model.Date)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.EndRegistrationDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.EndRegistrationDate)
            @Html.ValidationMessageFor(model => model.EndRegistrationDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Nombre)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Nombre)
            @Html.ValidationMessageFor(model => model.Nombre)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>
    
        <div style="padding-top:20px">
            @Html.ActionLink("Agregar organizador", "ShowOrganizers", new { id = Model.ID }, new { @class = "roundedButton" })
            @Html.ActionLink("Eliminar organizador", "RemoveOrganizers", new { id = Model.ID }, new { @class = "roundedButton" })
        </div>
    
        @{    
            if (ViewBag.isAdmin)
            {
                    <div style="padding-top:20px" >
                        @Html.ActionLink("Agregar participante", "ShowParticipantes", new { id = Model.ID }, new { @class = "roundedButton" })
                        @Html.ActionLink("Eliminar participantes", "RemoveParticipantes", new { id = Model.ID }, new { @class = "roundedButton" })
                    </div>
            }
        }
        <p>
            <input type="submit" value="Guardar" />
        </p>
    </fieldset>
}

 

<div>
    @Html.ActionLink("Volver", "Index", null, new { @class = "roundedButton" })
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
